package com.example.demo.rest.ecom;

import com.example.demo.api.ecom.ProductApi;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {
    @Autowired
    ProductApi productApi;

    @GetMapping("getProductDetails")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code", value = "code", paramType = "query", defaultValue = ""),
            @ApiImplicitParam(name = "options", value = "options", paramType = "query", defaultValue = ""),
            @ApiImplicitParam(name = "contextString", value = "contextString", paramType = "query", defaultValue = "")}
    )
    public Object getProductDetails(@RequestParam("code") String code, @RequestParam("options") String options, @RequestParam("contextString") String contextString) {
        return productApi.getProductDetails(code, options, contextString);
    }

}
